1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */ 
28 
29 module derelict.glib.gmessages;
30 
31 import derelict.glib.gtypes;
32 import derelict.glib.glibconfig;
33 import core.stdc.config;
34 import std.c.stdarg;
35 
36 extern (C):
37 
38 alias _Anonymous_0 GLogLevelFlags;
39 alias void function (const(char)*, _Anonymous_0, const(char)*, void*) GLogFunc;
40 alias void function (const(char)*) GPrintFunc;
41 
42 enum _Anonymous_0
43 {
44 	G_LOG_FLAG_RECURSION = 1,
45 	G_LOG_FLAG_FATAL = 2,
46 	G_LOG_LEVEL_ERROR = 4,
47 	G_LOG_LEVEL_CRITICAL = 8,
48 	G_LOG_LEVEL_WARNING = 16,
49 	G_LOG_LEVEL_MESSAGE = 32,
50 	G_LOG_LEVEL_INFO = 64,
51 	G_LOG_LEVEL_DEBUG = 128,
52 	G_LOG_LEVEL_MASK = -4
53 }
54 
55 
56 version(Derelict_Link_Static)
57 {
58     extern( C ) nothrow 
59     {
60 	    gsize g_printf_string_upper_bound(const(gchar)* format, va_list args);
61         guint g_log_set_handler(const(gchar)* log_domain, GLogLevelFlags log_levels, GLogFunc log_func, gpointer user_data);
62         void g_log_remove_handler(const(gchar)* log_domain, guint handler_id);
63         void g_log_default_handler(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* message, gpointer unused_data);
64         GLogFunc g_log_set_default_handler(GLogFunc log_func, gpointer user_data);
65         void g_log(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* format, ...);
66         void g_logv(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* format, va_list args);
67         GLogLevelFlags g_log_set_fatal_mask(const(gchar)* log_domain, GLogLevelFlags fatal_mask);
68         GLogLevelFlags g_log_set_always_fatal(GLogLevelFlags fatal_mask);
69         void _g_log_fallback_handler(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* message, gpointer unused_data);
70         void g_return_if_fail_warning(const(char)* log_domain, const(char)* pretty_function, const(char)* expression);
71         void g_warn_message(const(char)* domain, const(char)* file, int line, const(char)* func, const(char)* warnexpr);
72         void g_assert_warning(const(char)* log_domain, const(char)* file, const int line, const(char)* pretty_function, const(char)* expression);
73         void g_print(const(gchar)* format, ...);
74         GPrintFunc g_set_print_handler(GPrintFunc func);
75         void g_printerr(const(gchar)* format, ...);
76         GPrintFunc g_set_printerr_handler(GPrintFunc func);
77     }
78 }
79 else
80 {
81     extern( C ) nothrow 
82     {
83 	    alias da_g_printf_string_upper_bound = gsize function(const(gchar)* format, va_list args);																				
84         alias da_g_log_set_handler = guint function(const(gchar)* log_domain, GLogLevelFlags log_levels, GLogFunc log_func, gpointer user_data);								
85         alias da_g_log_remove_handler = void function(const(gchar)* log_domain, guint handler_id);																				
86         alias da_g_log_default_handler = void function(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* message, gpointer unused_data);						
87         alias da_g_log_set_default_handler = GLogFunc function(GLogFunc log_func, gpointer user_data);																			
88         alias da_g_log = void function(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* format, ...);															
89         alias da_g_logv = void function(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* format, va_list args);												
90         alias da_g_log_set_fatal_mask = GLogLevelFlags function(const(gchar)* log_domain, GLogLevelFlags fatal_mask);															
91         alias da_g_log_set_always_fatal = GLogLevelFlags function(GLogLevelFlags fatal_mask);																					
92         alias da__g_log_fallback_handler = void function(const(gchar)* log_domain, GLogLevelFlags log_level, const(gchar)* message, gpointer unused_data);						
93         alias da_g_return_if_fail_warning = void function(const(char)* log_domain, const(char)* pretty_function, const(char)* expression);										
94         alias da_g_warn_message = void function(const(char)* domain, const(char)* file, int line, const(char)* func, const(char)* warnexpr);									
95         alias da_g_assert_warning = void function(const(char)* log_domain, const(char)* file, const int line, const(char)* pretty_function, const(char)* expression);			
96         alias da_g_print = void function(const(gchar)* format, ...);																											
97         alias da_g_set_print_handler = GPrintFunc function(GPrintFunc func);																									
98         alias da_g_printerr = void function(const(gchar)* format, ...);																											
99         alias da_g_set_printerr_handler = GPrintFunc function(GPrintFunc func);	
100     }
101 
102     __gshared
103     {
104 	    da_g_printf_string_upper_bound g_printf_string_upper_bound; 
105         da_g_log_set_handler g_log_set_handler; 
106         da_g_log_remove_handler g_log_remove_handler; 
107         da_g_log_default_handler g_log_default_handler; 
108         da_g_log_set_default_handler g_log_set_default_handler; 
109         da_g_log g_log; 
110         da_g_logv g_logv; 
111         da_g_log_set_fatal_mask g_log_set_fatal_mask; 
112         da_g_log_set_always_fatal g_log_set_always_fatal; 
113         da__g_log_fallback_handler _g_log_fallback_handler; 
114         da_g_return_if_fail_warning g_return_if_fail_warning; 
115         da_g_warn_message g_warn_message; 
116         da_g_assert_warning g_assert_warning; 
117         da_g_print g_print; 
118         da_g_set_print_handler g_set_print_handler; 
119         da_g_printerr g_printerr; 
120         da_g_set_printerr_handler g_set_printerr_handler; 
121     }
122 }